package koujie;
import java.lang.invoke.SwitchPoint;
import java.util.Scanner;
public class UserComputer {
    public void useCom(Computer com,int one,int two){
        com.computer(one,two);
    }
    public static void main(String[] args){
        UserComputer userComputer=new UserComputer();
        Scanner sc=new Scanner(System.in);
        System.out.println("请选择:1,加法,2,减法; 3:乘法;4:除法");
        int num=sc.nextInt();
        Computer com=null;
        switch(num){
            case 1:
                com=new he();
                break;
            case 2:
                com=new jia();
                break;
            case 3:
                com=new ch();
                break;
            case 4:
                com=new chu();
                break;
            default:
                System.out.println("输入有误，请重新输入");
                return;
        }
        System.out.println("请输入第一个数字");
        int num1=sc.nextInt();
        System.out.println("请输入第二个数");
        int num2=sc.nextInt();
        userComputer.useCom(com,num1,num2);
    }

}
